﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Products.aspx.cs" Inherits="INHollandair.Shop.Products" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script  src="/Scripts/jquery-ui-1.8.17.min.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $(function () {
                $("#MainContent_FromDate").datepicker({ dateFormat: 'dd-mm-yy' });
            });
        });
	</script>
    <div class="container pull-down">
        <div class="row">
            <div class="span8 offset2">
                <h1>Producten</h1>
                <fieldset class="well roundedBorder form-horizontal">
                    <asp:Panel ID="pnl_Login" runat="server" DefaultButton="ProductSearchButton">
                        <div class="control-group">
                            <label class="control-label" for="UserName">Kies een datum</label>
                            <div class="controls">
                                <asp:TextBox ID="FromDate" runat="server" ValidationGroup="Search"></asp:TextBox>
                                <asp:RequiredFieldValidator Display="Dynamic" ID="FromDateRequired" runat="server" ValidationGroup="Search" ControlToValidate="FromDate" ErrorMessage=""></asp:RequiredFieldValidator>
                            </div>
                        </div>
                        <div class="form-actions">
                            <asp:Button ID="ProductSearchButton" runat="server" Text="Zoeken" Cssclass="btn btn-inverse" onclick="ProductSearchButtonClick" ValidationGroup="Search" />
                            <asp:Button ID="ProductSearchResetButton" runat="server" Text="Reset" Cssclass="btn" onclick="ProductSearchResetButtonClick" />
                            <p class="help-block">
                                <asp:Label ID="errorLabel" ForeColor="Red" runat="server" Text=""></asp:Label>
                            </p>
                        </div>    
                    </asp:Panel>
                    <h3><asp:Label ID="SearchHeaderLabel" runat="server" Text=""></asp:Label></h3>
                    <asp:Label ID="EmptyListLabel" runat="server" Text=""></asp:Label>
                    <asp:GridView ID="ProductGrid" 
                        CssClass="table table-striped table-condensed table-bordered" runat="server" 
                        AutoGenerateColumns="False" onrowcommand="ProductGrid_RowCommand">
                       <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>Bestemming</HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label
                                        ID="NameField" 
                                        Text=' <%#Eval("Name")%>'      
                                        width="100px" 
                                        runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>Price (Miles)</HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label
                                        ID="PriceField" 
                                        Text='<%#Eval("Price")%>'      
                                        width="100px" 
                                        runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <HeaderTemplate>Date</HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label
                                        ID="DateField" 
                                        Text='<%#((DateTime)Eval("Date")).ToString("dd-MM-yyyy")%>'      
                                        width="100px" 
                                        runat="server" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField>
                              <ItemTemplate>
                                    <asp:LinkButton runat="server" CssClass="btn btn-small" ID="btn_showProduct" Text="Geef product weer" CommandName="ShowProduct" CommandArgument='<%# Eval("Id")%>' />
                              </ItemTemplate> 
                                <HeaderStyle Width="115px" />
                                <ItemStyle Width="115px" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </fieldset>
            </div>
        </div>
    </div>
</asp:Content>